<?php
	@$intro = $_POST['intro'];
	if(isset($intro))
	{
		$query = sprintf("update static_page set content = '%s' where ref = 'introduction'", $intro);
		$exec_mysql->execute($query, 0);
		echo '<script type="text/javascript">showAlert(\'Thông báo\', \'Cập nhật thành công\', \'\');</script>';
	}
	$intro = $exec_mysql->execute("select content from static_page where ref = 'introduction'", 1);
?>
<form method="post">
	<table class="form-layout">
    	<tr>
        	<td>
            	<textarea id="editor" name="intro" ><?php echo $intro; ?></textarea>
				<script>
                    CKEDITOR.replace('editor',{
                        enterMode: CKEDITOR.ENTER_BR,
						height: '500px'
                    });
                    CKEDITOR.on('instanceReady',function() {
                        adjustSize();
                    });
                </script>
            </td>
        </tr>
    </table>
    <p class="footer-form">
    	<input type="submit" value="Cập nhật" />
    </p>
</form>